import requests

class Base():
    def __init__(self,url):
        self.url = url

    def post(self,url,status = None,data = None,headers = None):
        url = f"{self.url}{url}"
        if status == "json":
            req = requests.post(url,json = data,headers=headers)
        elif status == "data":
            req = requests.post(url,data = data,headers=headers)
        else:
            req = requests.post(url,params = data,headers=headers)
        return req
    def get(self,url,status = None,data = None,headers = None):
        url = f"{self.url}{url}"
        if status == "json":
            req = requests.get(url,json = data,headers=headers)
        elif status == "data":
            req = requests.get(url,data = data,headers=headers)
        else:
            req = requests.get(url,params = data,headers=headers)
        return req
    def put(self,url,status = None,data = None,headers = None):
        url = f"{self.url}{url}"
        if status == "json":
            req = requests.put(url,json = data,headers=headers)
        elif status == "data":
            req = requests.put(url,data = data,headers=headers)
        else:
            req = requests.put(url,params = data,headers=headers)
        return req
    def delete(self,url,status = None,data = None,headers = None):
        url = f"{self.url}{url}"
        if status == "json":
            req = requests.delete(url,json = data,headers=headers)
        elif status == "data":
            req = requests.delete(url,data = data,headers=headers)
        else:
            req = requests.delete(url,params = data,headers=headers)
        return req

